{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "Intersect a Volume (voxel dataset) with planes.\n",
    "\"\"\"\n",
    "from vedo import *\n",
    "\n",
    "embedWindow('panel')\n",
    "\n",
    "vol = load(datadir+\"embryo.slc\")\n",
    "\n",
    "pos = vol.imagedata().GetCenter()\n",
    "\n",
    "lines = []\n",
    "for i in range(60):  # probe scalars on 60 parallel lines\n",
    "    step = (i - 30) * 2\n",
    "    p1, p2 = pos + vector(-100, step, step), pos + vector(100, step, step)\n",
    "    a = probeLine(vol, p1, p2, res=50)\n",
    "    a.alpha(0.5).lineWidth(6)\n",
    "    lines.append(a)\n",
    "    # print(a.getPointArray()) # numpy scalars can be access here\n",
    "    # print(i, a.getPointArray('vtkValidPointMask')) # the mask of valid points\n",
    "\n",
    "show(lines)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
